package com.tool.mylibrary.base;

import android.os.Bundle;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.view.View;

import com.tool.mylibrary.interfaces.UIInterface;
import com.tool.mylibrary.utils.ActivityCollector;


public abstract class BaseActivity extends AppCompatActivity implements View.OnClickListener, UIInterface {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        ActionBar actionBar = getSupportActionBar();
        if (actionBar != null) {
            actionBar.hide();
        }
        ActivityCollector.addActivity(this);
        //得到布局文件
        setContentView(getLayoutId());
        //初始化View
        initView();
        //初始化界面数据
        initData();
        //绑定监听器与适配器
        initListener();
    }


    @Override
    protected void onDestroy() {
        super.onDestroy();
        ActivityCollector.removeActivity(this);

    }

    @Override
    public void onClick(View v) {
        processClick(v);
    }


}
